<template>
  <div class="aui-card-list">
    <el-card shadow="never" class="aui-card-list-body">
      <el-tabs v-model="activeName" @tab-click="tabsClick">
        <el-tab-pane label="全部" name="1">
        </el-tab-pane>
        <el-tab-pane label="按功能" name="2">
        </el-tab-pane>
      </el-tabs>
      <behavior-log ref="behaviorLog" v-if="this.activeName==='1'"></behavior-log>
      <behavior-menu ref="behaviorMenu" v-if="this.activeName==='2'"></behavior-menu>
    </el-card>
  </div>
</template>

<script>
import behaviorLog from './sysLogUserBehavior-log'
import behaviorMenu from './sysLogUserBehavior-menu'
export default {
  data () {
    return {
      activeName: '1'
    }
  },
  activated () {
    this.activatedTab()
  },
  components: {
    behaviorLog,
    behaviorMenu
    // behaviorUser
    // todo, done
  },
  methods: {
    tabsClick () {
      this.$nextTick(() => {
        this.activatedTab()
      })
    },
    activatedTab () {
      if (this.activeName === '1') {
        this.$refs.behaviorLog.getDataList()
      } else if (this.activeName === '2') {
        this.$refs.behaviorMenu.getDataList()
      } else if (this.activeName === '3') {
        this.$refs.behaviorUser.getDataList()
      }
    }
  }
}
</script>

<style>
</style>
